package com.wanxi.spring.cloud.user.service;

import com.wanxi.spring.cloud.commons.api.CommonResult;
import com.wanxi.spring.cloud.user.model.User;
import com.wanxi.spring.cloud.user.model.UserRole;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 蒋帆
 * @since 2020-12-21
 */
public interface UserService {

    /**
     * 通过用户名查找用户
     * @param username
     * @return
     */
    CommonResult getUserByName(String username);

    /**
     * 注册
     * @param user
     * @return
     */
    CommonResult register(User user);

    /**
     * 获取用户列表
     * @param map
     * @return
     */
    CommonResult getUsers(Map map);

    CommonResult deleteUser(String code);

    CommonResult updateUser(User user);

    CommonResult getCodeList();

    CommonResult updateStatus(String code, String status);

    CommonResult getLeaderList();

    CommonResult getCoachList();

    CommonResult getTeamUser(Integer teamId);

    CommonResult getTeamMember(Integer teamId);

    CommonResult getTeamMemberByUser(Integer userId);

    CommonResult getNoSignTeamMemberByUser(Integer userId);

    User selectUserById(int id);

    User getUserByCode(String code);

    int updateUserRole(UserRole userRole);
}
